Skip to content

fix(sandbox): rotate openshell.log daily, keep 3 files#431

Merged
drew merged 1 commit intoNVIDIA:mainfrom
Kh4L:fix/sandbox-log-rotation
Mar 19, 2026
Merged

fix(sandbox): rotate openshell.log daily, keep 3 files#431
drew merged 1 commit intoNVIDIA:mainfrom
Kh4L:fix/sandbox-log-rotation

Conversation

@Kh4L
Copy link
Contributor

@Kh4L Kh4L commented Mar 18, 2026

Summary

  • Replaces the unbounded append-only /var/log/openshell.log with a RollingFileAppender that rotates daily and retains at most 3 files
  • No new dependencies — tracing-appender is already a workspace dependency in openshell-sandbox
  • Falls back to stdout-only logging if /var/log is not writable (existing behavior preserved)

Related Issue

Closes #30

Changes

  • crates/openshell-sandbox/src/main.rs: replace std::fs::OpenOptions + non_blocking(file) with RollingFileAppender::builder() configured for daily rotation and a 3-file cap

Testing

  • mise run test passes
  • Sandbox logs appear as /var/log/openshell.YYYY-MM-DD.log inside a running sandbox
  • Old log files beyond the 3-file limit are pruned on rotation

Checklist

  • Follows Conventional Commits format
  • Signed-off-by line included (git commit -s)
  • No new dependencies introduced

Replace unbounded append-only log with a RollingFileAppender
(daily rotation, max 3 files). tracing-appender is already a
workspace dependency so no new crates are needed.

Closes NVIDIA#30

Signed-off-by: Serge Panev <spanev@nvidia.com>
@Kh4L Kh4L requested a review from a team as a code owner March 18, 2026 08:13
@github-actions
Copy link

Thank you for your interest in contributing to OpenShell, @Kh4L.

This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer.

To get vouched:

  1. Open a Vouch Request discussion.
  2. Describe what you want to change and why.
  3. Write in your own words — do not have an AI generate the request.
  4. A maintainer will comment /vouch if approved.
  5. Once vouched, open a new PR (preferred) or reopen this one after a few minutes.

See CONTRIBUTING.md for details.

@github-actions github-actions bot closed this Mar 18, 2026
@johntmyers
Copy link
Collaborator

Reopening — you were incorrectly closed by the vouch gate. The workflow couldn't verify your NVIDIA org membership due to a GITHUB_TOKEN permissions issue. Fix is in #442.

@johntmyers johntmyers reopened this Mar 18, 2026
@github-actions
Copy link

Thank you for your interest in contributing to OpenShell, @Kh4L.

This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer.

To get vouched:

  1. Open a Vouch Request discussion.
  2. Describe what you want to change and why.
  3. Write in your own words — do not have an AI generate the request.
  4. A maintainer will comment /vouch if approved.
  5. Once vouched, open a new PR (preferred) or reopen this one after a few minutes.

See CONTRIBUTING.md for details.

@github-actions github-actions bot closed this Mar 18, 2026
@johntmyers
Copy link
Collaborator

Reopening now that #442 has merged. The vouch gate will now check author_association from the webhook payload, which correctly identifies you as an NVIDIA org member.

@johntmyers johntmyers reopened this Mar 18, 2026
@github-actions
Copy link

Thank you for your interest in contributing to OpenShell, @Kh4L.

This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer.

To get vouched:

  1. Open a Vouch Request discussion.
  2. Describe what you want to change and why.
  3. Write in your own words — do not have an AI generate the request.
  4. A maintainer will comment /vouch if approved.
  5. Once vouched, open a new PR (preferred) or reopen this one after a few minutes.

See CONTRIBUTING.md for details.

@johntmyers
Copy link
Collaborator

Reopening — the vouch gate now fetches author_association via the REST API (#444), which correctly identifies you as an NVIDIA org member. Sorry for the repeated closures!

@johntmyers johntmyers reopened this Mar 18, 2026
@github-actions
Copy link

Thank you for your interest in contributing to OpenShell, @Kh4L.

This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer.

To get vouched:

  1. Open a Vouch Request discussion.
  2. Describe what you want to change and why.
  3. Write in your own words — do not have an AI generate the request.
  4. A maintainer will comment /vouch if approved.
  5. Once vouched, open a new PR (preferred) or reopen this one after a few minutes.

See CONTRIBUTING.md for details.

@drew drew merged commit 564c411 into NVIDIA:main Mar 19, 2026
64 of 67 checks passed
drew added a commit that referenced this pull request Mar 19, 2026
The rolling file appender introduced in PR #431 writes date-stamped
files (openshell.YYYY-MM-DD.log) instead of a single openshell.log.
Update _read_openshell_log() and _verify_sandbox_functional() to glob
for all matching log files so the tests work with both layouts.

Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(sandbox): implement automatic logfile rollover for /var/log/navigator.log

3 participants